package exercise;

public class Main {

    public static void main(String[] args) {
        Directory root = new Directory("root", null);
        Directory bin = new Directory("bin", root);
        Directory tmp = new Directory("tmp", root);
        Directory usr = new Directory("usr", root);

        root.add(bin);
        root.add(tmp);
        root.add(usr);

        File vi = new File("vi", 10000, bin);
        File latex = new File("latex", 20000, bin);

        bin.add(vi);
        bin.add(latex);

        Directory yuki = new Directory("yuki", usr);
        Directory hanako = new Directory("hanako", usr);
        Directory tomura = new Directory("tomura", usr);

        usr.add(yuki);
        usr.add(hanako);
        usr.add(tomura);

        File diary = new File("diary.html", 1000, yuki);
        File composite = new File("Composite.java", 2000, yuki);

        yuki.add(diary);
        yuki.add(composite);

        File memo = new File("memo.tex", 300, hanako);
        hanako.add(memo);

        File game = new File("game.doc", 400, tomura);
        File lunk = new File("lunk.mail", 500, tomura);
        tomura.add(game);
        tomura.add(lunk);

        root.printList();

        // 习题 11-2
        lunk.getPath();
        usr.getPath();
        root.getPath();
    }

}
